package com.yami.shop.mystery.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.mystery.common.model.ActivityProd;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 活动扩展业务接口
 *
 * @author wxf
 * @date 2023/4/12 10:31
 */
public interface ActivityProdService extends IService<ActivityProd> {

    /**
     * 修改报名注水量
     *
     * @param activityProd
     */
    void updateWaterSoldNum(ActivityProd activityProd);

    /**
     * 通过活动id查询商品列表
     *
     * @param activityId
     * @return
     */
    List<ActivityProd> listByActivityId(Long activityId);

    /**
     * 功能描述: 回显商品信息
     * @Author: LSR
     * @Date: 2023/9/4 18:40
     */
    List<ActivityProd> listByActivityId(Long id, Long blindType);


    /**
     * 减少活动库存
     * @param activityId
     * @param prodCount
     * @param prodId
     */
    void decrActivitySkuStocks(Long activityId, Integer prodCount, Long prodId);

    /**
     * 根据活动id与商品ID获取活动商品信息
     *
     * @param activityId
     * @param prodId
     * @return
     */
    ActivityProd getActivitySkuByActivityIdAndProdId(Long activityId, Long prodId) ;

    /**
     * 删除缓存
     * @param activityId
     * @param prodId
     */
    void removeActivitySkuCache(Long activityId, Long prodId);

    /**
     * 修改库存
     *
     * @param activityId
     * @param prodId
     * @param prodCount
     * @return
     */
    int updateStocks(Long activityId, Long prodId,Integer prodCount);

    /**
     * 还原库存
     *
     * @param activityId
     * @param prodId
     * @param prodCount
     */
    int returnStocks(Long activityId, Long prodId, Integer prodCount);
}
